{include file="public/head"/}

<style>
    i img {
        width: 20px;
    }
</style>
<div class="container-fluid" id="main">
    <div class="row clearfix" id="search-box" style="margin-top:0">
        <div class="col-md-12 column text-right">
            <div class="form-inline" style="text-align: right;">
                <div class="form-group">
                    <input type="text" class="form-control" id="searchText" value="" placeholder="{:strtoupper(lang('please_enter_a_function_name'))}">
                    <input type="text" class="form-control" id="control" value="" placeholder="{:strtoupper(lang('please_enter_the_conroller'))}">
                </div>
                <div class="form-group">
                    <button type="" @click="getSearchText()" class="btn btn-default">{:strtoupper(lang('search'))}</button>
                </div>
            </div>
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="alert alert-dismissable alert-info">
                <button type="button" class="close">×</button>
                <p></p>

            </div>
            <div id="notice"></div>
        </div>
    </div>


    <div class="ntDesktop">
        <div class="ntDesktop-head">{:strtoupper(lang('function_list'))}</div>

        <div class="row clearfix">
            <div class="col-md-6 col-md-offset-6 col-sm-8 col-sm-offset-4 column text-right">
                <div>
                    <div  class="form-inline" role="form">
                    <a href="{:url('menu/addopen',array('request'=>'add_top_menu'))}" class='btn btn-sm btn-primary option-del' data-toggle="modal" data-target="#prosModal" v-if="auth_ids.indexOf(355) != -1">{:strtoupper(lang('add_top_menu'))}</a>

                    </div>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-12 column">
                <table class="table table-striped table-hover ntTable" v-cloak>
                    <thead>
                        <tr>
                            <th  style="padding-left: 20px">ID</th>
                            <th  style="padding-left: 20px">功能名称</th>
                            <th>{:strtoupper(lang('controller'))}</th>
                            <th>{:strtoupper(lang('method'))}</th>
                            <th>{:strtoupper(lang('model_name'))}</th>
                            <th>{:strtoupper(lang('locking'))}</th>
                            <th>{:strtoupper(lang('classify'))}</th>
                            <th style="text-align: center">{:strtoupper(lang('operate'))}</th>
                        </tr>
                    </thead>
                    <tbody>
                            <tr v-for="(item,index) in datalist" v-if="item.is_show">
                            <td  style="padding-left: 20px">{{item.id}}</td>
                            <td>
                                <template v-for="(itemlevel,indexlevel) in item.level">&nbsp;&nbsp;&nbsp;&nbsp;</template>
                                <a href="javascript:;" class="menuname" @click="changemenuname(item.id,item.toggle,item.pid)">
                                    <i v-if="item.child > 0" style="margin-right: 20px;">
                                            <span  v-if="item.toggle" ><span class="glyphicon glyphicon-minus" style="margin-right:0"></span></span>
                                            <span  v-if="!item.toggle" ><span class="glyphicon glyphicon-plus" style="margin-right:0"></span></span>
                                    </i>
                                    <i v-if="item.child == 0" style="width: 20px;height: 20px;display: inline-block;margin-right: 20px;"></i>
                                    <span v-if="item.child > 0" :class="['glyphicon', item.style]"></span>
                                    {{item.content}}
                                </a>
                            </td>
                            <td>{{item.control}}</td>
                            <td>{{item.option}}</td>
                            <td>{{item.style}}</td>
                            <td>{{item.is_disable}}</td>
                            <td>{{item.drank}}</td>
                            <td style="text-align: right">
                                <div>
                                    <a :href="'/admin/menu/addopen?id='+item.id+'&request=add_sub-functions&pid='+item.pid" class='btn btn-sm btn-primary option-del' data-toggle="modal" data-target="#prosModal" v-if="auth_ids.indexOf(355) != -1">{:strtoupper(lang('add_sub-functions'))}</a>
                                    <a :href="'/admin/menu/editopen?id='+item.id+'&pid='+item.pid" class='btn btn-sm btn-default option-recover' data-toggle="modal" data-target="#prosModal" v-if="auth_ids.indexOf(356) != -1">{:strtoupper(lang('edit'))}</a>
                                    <a href="#" class="btn btn-sm btn-default option-hide" @click="evdel(item.id,1)" v-if="item.disable=='0' && auth_ids.indexOf(358) != -1">
                                        <span class="fa fa-lock"></span>{:strtoupper(lang('locking'))} </a>
                                    <a href="#" class="btn btn-sm btn-default option-hide" @click="evdel(item.id,0)" v-if="item.disable=='1' && auth_ids.indexOf(358) != -1">
                                        <span class="fa fa-unlock"></span>{:strtoupper(lang('unlock'))} </a>
                                    <!-- <a  href="#" data-id="{item.id}" class='btn btn-sm btn-default option-clear' @click="evdel(item.id)" v-if="item.disable!='1'">{:lang('delete')}</a> -->
                                    <a href="javascript:;" class='btn btn-sm btn-danger option-clear'@click="requestDelete(item.id)" v-if="item.disable==1 && auth_ids.indexOf(359) != -1">
                                        <span class="glyphicon glyphicon-fire"></span> {:strtoupper(lang('clear'))}</a>
                                </div>
                            </td>
                        </tr>
                        <tr style="text-align: center;"  v-if="datalist.length==0">
                                <td colspan="8" class="no_date">{:lang('no_data')}</td>
                            </tr>
                    </tbody>
                </table>
            </div>
        </div>



    </div>
</div>

<!--弹窗部分 开始-->
<div class="modal fade" id="prosModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg" style="width:1000px">
        <div class="modal-content">
        </div>
    </div>
</div>
<script>
    $("#prosModal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
        $(".modal-content").children().remove();
    });
</script>
<script src="/static/Admin/js/menu.js"></script>
{include file="public/foot"/}